//
//  YPForgotPasswordViewController.m
//  ChengHuiTong
//
//  Created by KiVen on 15/11/19.
//  Copyright © 2015年 张文权. All rights reserved.
//

#import "YPForgotPasswordViewController.h"
#import "YPGetCodeModel.h"
#import "YPRegistOneTableViewCell.h"

#import "SetPassWordTableViewCell.h"
@interface YPForgotPasswordViewController ()<UITableViewDataSource,UITableViewDelegate>{
    
    
    /**
     *  时间变量
     */
    int _remainingTime;
    
    TPKeyboardAvoidingTableView * _forgetPasswordTableView;


}

@property(nonatomic,strong)NSArray *dataSource;

@end

@implementation YPForgotPasswordViewController{
    
    
    NSString*_phoneNum,*_smsid,*_oldPwd,*_newPwd,*_againPwd,*_code;
    
    
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self creatView];
    
}

- (void)viewWillAppear:(BOOL)animated{
    
    [super viewWillAppear:YES];
    
    [MobClick beginLogPageView:@"忘记密码"];
    
}
- (void)viewWillDisappear:(BOOL)animated{
    
    [super viewWillDisappear:YES];
    
    [MobClick endLogPageView:@"忘记密码"];
}
- (void)creatView{
    
    
    //    大的背景图
    _backGroudScrollView = [[TPKeyboardAvoidingScrollView alloc]init];
    _backGroudScrollView.frame = CGRectMake(0, 0,SCREEN_WIDTH , SCREEN_HEIGHT);
    _backGroudScrollView.contentSize = CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT);
    _backGroudScrollView.scrollEnabled = NO;
    _backGroudScrollView.backgroundColor = UIColorFromRGB(0xf5f5f5);
    [self.view addSubview:_backGroudScrollView];

    
    _forgetPasswordTableView = [[TPKeyboardAvoidingTableView alloc]initWithFrame:CGRectMake(0, 15, SCREEN_WIDTH, SCREEN_HEIGHT-64) style:UITableViewStylePlain];
    _forgetPasswordTableView.dataSource = self;
    _forgetPasswordTableView.delegate = self;
    _forgetPasswordTableView.scrollEnabled = NO;
    //    没有数据的时候  去掉单元格的细线
    _forgetPasswordTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    
    UIView * tableFootView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    tableFootView.backgroundColor =  UIColorFromRGB(0xf5f5f5);
    
        UIButton * nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
        nextButton.frame = CGRectMake(10, 15, SCREEN_WIDTH-20, 40);
        nextButton.backgroundColor = kColor_AppNavColor;
        [nextButton setTitle:@"确定" forState:UIControlStateNormal];
        [nextButton addTarget:self action:@selector(nextButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [tableFootView addSubview:nextButton];

    
    _forgetPasswordTableView.tableFooterView=tableFootView;
    [_backGroudScrollView addSubview:_forgetPasswordTableView];
    
    
    
    NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:1 inSection:0];
    YPRegistOneTableViewCell * cell1 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath1];

    [cell1.getCodeButton addTarget:self action:@selector(getVerificationCodeButtonClick) forControlEvents:UIControlEventTouchUpInside];
    

    
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;{
    
    return self.dataSource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;{
    
    if (!_isSetPassword) {
        
    
    
    if (indexPath.row == 1) {
        
        YPRegistOneTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell0"];
        if (!cell) {
            cell = [[YPRegistOneTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell0"];
            cell.contentTextField.keyboardType = UIKeyboardTypeNumberPad;
            [cell.contentTextField addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventEditingChanged];


        }
        
        cell.contentTextField.tag=20+indexPath.row;

        cell.titleLabel.text = [_dataSource[indexPath.row]objectForKey:@"title"];
        return cell;

        
    }else{
    
    
        
        YPRegistOneTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell1"];
        if (!cell) {
            cell = [[YPRegistOneTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell1"];
            
            
            [cell.contentTextField addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventEditingChanged];
            
           
        }
        
        
        
        cell.contentTextField.tag=20+indexPath.row;
        
            
            if (indexPath.row ==0) {
                
                
                cell.contentTextField.placeholder = @"请输入您的手机号";
                cell.contentTextField.keyboardType = UIKeyboardTypeNumberPad;
                
                
            }   else {
                cell.contentTextField.placeholder = @"8-20位字母或数字";
                cell.contentTextField.secureTextEntry = YES;
                
            }
            
        

        
        
        
        cell.titleLabel.text = [_dataSource[indexPath.row]objectForKey:@"title"];

        return cell;
    }
    
    
    }else{
        
        
        
        
        if (indexPath.row == 1) {
            
            YPRegistOneTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell0"];
            if (!cell) {
                cell = [[YPRegistOneTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell0"];
                cell.contentTextField.keyboardType = UIKeyboardTypeNumberPad;
                [cell.contentTextField addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventEditingChanged];
                
                
            }
            
            cell.contentTextField.tag=20+indexPath.row;
            
            cell.titleLabel.text = [_dataSource[indexPath.row]objectForKey:@"title"];
            return cell;
            
            
        }else if (indexPath.row==0){
            
            
            SetPassWordTableViewCell*cell=[tableView dequeueReusableCellWithIdentifier:@"cell2"];
            
            if (!cell) {
                
                cell=[[SetPassWordTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell2"];
                
                cell.selectionStyle=0;
            }
            
            NSMutableString*phoneString=[[NSMutableString alloc] initWithString:[YPShareAccountInfo shareAccountInfo].phone];
            
            [phoneString replaceCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
            
            cell.phoneLabel.text=phoneString;
            
            cell.titleLabel.text=@"手机号";
            
            
            return cell;

            
        }
        
        
        else{
            
            
            YPRegistOneTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell1"];
            if (!cell) {
                cell = [[YPRegistOneTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell1"];
                
                
                [cell.contentTextField addTarget:self action:@selector(textChange:) forControlEvents:UIControlEventEditingChanged];
                
                
            }
            
            
            
            cell.contentTextField.tag=20+indexPath.row;
            
            
           
                cell.contentTextField.placeholder = @"8-20位字母或数字";
                cell.contentTextField.secureTextEntry = YES;
                
            
            
            
            
            
            
            
            cell.titleLabel.text = [_dataSource[indexPath.row]objectForKey:@"title"];
            
            return cell;
        }
        
        
        
        
    }

}


- (void)getVerificationCodeButtonClick{
    
    
    
    YPGetCodeBin * bin = [[YPGetCodeBin alloc]init];
    if (_isSetPassword) {
        
        bin.phone=[YPShareAccountInfo shareAccountInfo].phone;
        
    }else{
        
        
        NSIndexPath *indexPath0 = [NSIndexPath indexPathForRow:0 inSection:0];
        YPRegistOneTableViewCell * cell0 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath0];

        if (cell0.contentTextField.text.length < 1) {
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入手机号码"];
            return;
        }
        if (![LGToolMethods validateMobile:cell0.contentTextField.text]) {
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入正确手机号码"];
            return;
        }

        bin.phone = cell0.contentTextField.text;

        
    }
    
    
//    获取手机号
   
    
    
    _remainingTime      = 60;

    [self buttonCountdown];
    
    
    [YPHttpRequestMethod sendAsyRequestURL:CMD_FORGET_PASSWORD_GET_CODE withData:[bin dictionaryValue] withCompletionBlock:^(NSDictionary *responseDictionary) {
        
        if ([responseDictionary[@"status"] intValue]== 0) {
            
            NSLog(@"responseDictionary%@",responseDictionary);
            
            YPGetCodeModel * model = [[YPGetCodeModel alloc]initWithDictionary:responseDictionary];
            self.getCodeModel = model;

        }
    } withFailedBlock:^(NSError *error) {
        
        
    } withIndicator:YES atView:self.view];

    
    

    
}
- (void)buttonCountdown{
    
//    获取验证码
    NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:1 inSection:0];
    YPRegistOneTableViewCell * cell1 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath1];
    
    if (_remainingTime > 0) {
        [self performSelector:@selector(buttonCountdown) withObject:nil afterDelay:1.0];
        _remainingTime--;
        [cell1.getCodeButton setTitle:[NSString stringWithFormat:@"%d秒",_remainingTime] forState:UIControlStateNormal];
        cell1.getCodeButton.userInteractionEnabled = NO;
        [cell1.getCodeButton setTitleColor:UIColorFromRGB(0xe4e3e2) forState:UIControlStateNormal];

        if (_remainingTime == 0) {
            
            [cell1.getCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal];
            cell1.getCodeButton.userInteractionEnabled = YES;
            [cell1.getCodeButton setTitleColor:kColor_AppNavColor forState:UIControlStateNormal];

        }
        
    }
    else{
        _remainingTime      = 60;
    }

    
}
- (void)nextButtonClick{
    
 
    if (_isSetPassword) {
        
        [self setPassWord];
        
    }else{
        
        
        [self findPassWord];
    }
    
    
    
}



-(void)findPassWord{
    //    获取手机号
    
//    NSIndexPath *indexPath0 = [NSIndexPath indexPathForRow:0 inSection:0];
//    YPRegistOneTableViewCell * cell0 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath0];
//    
//    //    获取验证码
//    
//    NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:1 inSection:0];
//    YPRegistOneTableViewCell * cell1 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath1];
//    
//    //    获取密码
//    NSIndexPath *indexPath2 = [NSIndexPath indexPathForRow:2 inSection:0];
//    YPRegistOneTableViewCell * cell2 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath2];
//    //获取确定密码
//    NSIndexPath *indexPath3 = [NSIndexPath indexPathForRow:3 inSection:0];
//    YPRegistOneTableViewCell * cell3 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath3];
    
    
    if (_phoneNum.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入手机号"];
        return;
        
    }
    if (_code.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入验证码"];
        return;
        
    }
    if (_newPwd.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入密码"];
        return;
        
    }
    if (_againPwd.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入确定密码"];
        return;
        
    }
    
    if (![_newPwd isEqualToString:_againPwd])
    {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码不一致"];
        return;
    }
    
    
    
    YPAgainResetPasswordBin * bin = [[YPAgainResetPasswordBin alloc]init];
    
    bin.encrypt=@"1";
    
    bin.phone=_phoneNum;
    
    bin.code = _code;
    
    bin.smsid= self.getCodeModel.smsid;
    
    bin.password =[GetCodeString getCodeWithString:_newPwd];
    
    
    
    
    [RequestModel POSTWithURRL:CMD_AGAIN_REST_PASSWORD andDic:[bin dictionaryValue] Block:^(id responseDictionary) {
        
        
        
        NSLog(@"responseDictionary:%@",responseDictionary);
        
        if ([responseDictionary[@"status"] intValue]== 0) {
            
            if (_popVC) {
                
                _popVC();
                
            }else{
                
                [self.navigationController dismissViewControllerAnimated:YES completion:^{
                    
                    
                    UIWindow*window=[UIApplication sharedApplication].keyWindow;
                    
                    [MBProgressHUD showError:@"设置成功,请使用新密码登录" toView:window];
                }];
                
            }
            
            
        }else if ([responseDictionary[@"status"] intValue]== 1010){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码已失效"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1011){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码不正确"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1007){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码小于与8位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1008){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码大于20位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 9000){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"系统繁忙,请稍后重试"];
        }
        
        
    } failBlock:^(id responseDictionary) {
        
    }];
    
    /*
     
     
    
    [YPHttpRequestMethod sendAsyRequestURL:CMD_AGAIN_REST_PASSWORD withData:[bin dictionaryValue] withCompletionBlock:^(NSDictionary *responseDictionary) {
        NSLog(@"responseDictionary:%@",responseDictionary);
        
        if ([responseDictionary[@"status"] intValue]== 0) {
            
            if (_popVC) {
                
                _popVC();
                
            }else{
                
                [self.navigationController dismissViewControllerAnimated:YES completion:^{
                    
                }];
                
            }
        }else if ([responseDictionary[@"status"] intValue]== 1010){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码已失效"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1011){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码不正确"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1007){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码小于与8位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1008){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码大于20位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 9000){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"系统繁忙,请稍后重试"];
        }
        
        
    } withFailedBlock:^(NSError *error) {
        
        
    } withIndicator:YES atView:self.view];

    
     
     */
}


-(void)setPassWord{
    
    
    //    获取手机号
    
    
    //    获取验证码
    
//    NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:1 inSection:0];
//    YPRegistOneTableViewCell * cell1 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath1];
//    
//    //    获取旧密码
//    NSIndexPath *indexPath2 = [NSIndexPath indexPathForRow:2 inSection:0];
//    YPRegistOneTableViewCell * cell2 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath2];
//    //获取密码
//    NSIndexPath *indexPath3 = [NSIndexPath indexPathForRow:3 inSection:0];
//    YPRegistOneTableViewCell * cell3 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath3];
//     //获取确定密码
//    NSIndexPath *indexPath4 = [NSIndexPath indexPathForRow:4 inSection:0];
//    
//    YPRegistOneTableViewCell * cell4 = [_forgetPasswordTableView cellForRowAtIndexPath:indexPath4];
       if (_code.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入验证码"];
        return;
        
    }
    if (_oldPwd.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入旧密码"];
        return;
        
    }
    
    if (_newPwd.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入新密码"];
        return;
        
    }
    
    if (_againPwd.length<1) {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"请输入确定密码"];
        return;
        
    }
    
    if (![_newPwd isEqualToString:_againPwd])
    {
        
        [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"两次密码不一致"];
        return;
    }
    
    
    
//    YPAgainResetPasswordBin * bin = [[YPAgainResetPasswordBin alloc]init];
//    
//    bin.phone =cell0.contentTextField.text;
//    bin.code = cell1.contentTextField.text;
//    bin.smsid= self.getCodeModel.smsid;
//    bin.password =cell2.contentTextField.text;
//    
    
    YPSetPasswordBin*bin=[[YPSetPasswordBin alloc] init];
    
    
        
         bin.phone =[YPShareAccountInfo shareAccountInfo].phone;
    
    
    
    
        bin.encrypt=@"1";
    
        bin.code = _code;
    
        bin.smsid= self.getCodeModel.smsid;
    
        bin.password =[GetCodeString getCodeWithString:_oldPwd];
    
        bin.npassword=[GetCodeString getCodeWithString:_newPwd];

    
    [RequestModel POSTWithURRL:CMD_AGAIN_SET_PASSWORD andDic:[bin dictionaryValue] Block:^(id responseDictionary) {
        NSLog(@"responseDictionary:%@",responseDictionary);
        
        if ([responseDictionary[@"status"] intValue]== 0) {
            
            if (_popVC) {
                
                _popVC();
                
                UIWindow*window=[UIApplication sharedApplication].keyWindow;
                
                [MBProgressHUD showError:@"您已成功重置密码，请登录" toView:window];
            }else{
                
                [self.navigationController dismissViewControllerAnimated:YES completion:^{
                    
                    
                    
                }];
                
            }
        }else if ([responseDictionary[@"status"] intValue]== 1010){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码已失效"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1011){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码不正确"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1007){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码小于与8位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1008){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码大于20位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 9000){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"系统繁忙,请稍后重试"];
        }else if ([responseDictionary[@"status"] intValue]== 1102){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"原密码错误"];
        }
        
        
    } failBlock:^(id obj) {
        
    }];
    
    /*
     
    
    
    [YPHttpRequestMethod sendAsyRequestURL:CMD_AGAIN_SET_PASSWORD withData:[bin dictionaryValue] withCompletionBlock:^(NSDictionary *responseDictionary) {
        NSLog(@"responseDictionary:%@",responseDictionary);
        
        if ([responseDictionary[@"status"] intValue]== 0) {
            
            if (_popVC) {
                
                _popVC();
                
            }else{
                
                [self.navigationController dismissViewControllerAnimated:YES completion:^{
                    
                }];
                
            }
        }else if ([responseDictionary[@"status"] intValue]== 1010){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码已失效"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1011){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"验证码不正确"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1007){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码小于与8位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 1008){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"密码大于20位"];
            
        }else if ([responseDictionary[@"status"] intValue]== 9000){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"系统繁忙,请稍后重试"];
        }else if ([responseDictionary[@"status"] intValue]== 1102){
            
            [YRProgressHUD autoShowHUDAddedTo:_backGroudScrollView withText:@"原密码错误"];
        }
        
        
    } withFailedBlock:^(NSError *error) {
        
        
    } withIndicator:YES atView:self.view];

     
      */
}


-(void)textChange:(UITextField*)textField{
    
    
    
    
    
    if (_isSetPassword) {
       
        switch (textField.tag-20) {
            case 1:{
                
                _code=textField.text;
                
            }
                
                break;
            case 2:{
                
                
                _oldPwd=textField.text;
                
            }
                
                break;
            case 3:{
                
                
                _newPwd=textField.text;
                
            }
                
                break;
            case 4:{
                
                
                _againPwd=textField.text;
                
            }
                
                break;
            
                
            default:
                break;
        }
        
        
    }else{
        
        
        switch (textField.tag-20) {
            case 0:{
                
                _phoneNum=textField.text;
                
            }
                
                break;
            case 1:{
                
                _code=textField.text;
                
            }
                
                break;
            case 2:{
                
                
                _newPwd=textField.text;
                
            }
                
                break;
            case 3:{
                
                
                _againPwd=textField.text;
                
            }
                
                break;
            
            default:
                break;
        }
        
        
    }
    
    
    
    
    
    
}

-(NSArray *)dataSource{
    
    if (!_dataSource) {
        
        if (_isSetPassword) {
            
            _dataSource = @[@{@"title":@"手机号"},
                            @{@"title":@"验证码"},
                            @{@"title":@"旧密码"},
                            @{@"title":@"新密码"},
                            @{@"title":@"确定密码"}];

        }else{
            
            
            _dataSource = @[@{@"title":@"手机号"},
                            @{@"title":@"验证码"},
                            @{@"title":@"新密码"},
                            @{@"title":@"确定密码"}];

        }
        
        
    }
    
    return _dataSource;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
